package com.songlanyun.modules.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.drive.IBaseService;
import com.songlanyun.modules.order.entity.Order;
import com.songlanyun.modules.order.entity.OrderReceipt;
import com.songlanyun.modules.order.model.dto.SubmitOrderDTO;
import com.songlanyun.modules.order.model.dto.SubmitOrderReceiptDTO;
import com.songlanyun.modules.order.model.vo.SubmitOrderVo;
import com.songlanyun.modules.payorder.entity.PayOrder;

/**
 * 销售系统中的主订单
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-16 14:14:42
 */
public interface OrderOperationService extends IService<Order> {

    /**
     * 第三方回调支付需要使用的服务
     * @param payOrder
     * @return
     */
    PayOrder pay(PayOrder payOrder);
    PayOrder payFail(PayOrder payOrder);


    /**
     * 取消支付
     * @param userId
     * @param payOrderId
     * @return
     */
    PayOrder cancelPay(Long userId,Long payOrderId);
    Boolean payExpireCancel(Long payOrderId);

    /**
     * 用余额支付
     * @param payOrderId
     * @return
     */
    PayOrder balancePay(Long userId,Long payOrderId);

    PayOrder voucherPay(Long userId,Long payOrderId);

    OrderReceipt updateReceipt(Long userId,Long orderId, Long  userAddressId);



    void updateReceiptForPayOrder(Long userId, Long payOrderId, Long userAddressId);
}

